home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / workbench / directoryopus4 / dopus4_src / config / screen_palette.c < prev    next >
C/C++ Source or Header  |  2000-03-11  |  2KB  |  78 lines

  1. /*
  2.  
  3. Directory Opus 4
  4. Original GPL release version 4.12
  5. Copyright 1993-2000 Jonathan Potter
  6.  
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. All users of Directory Opus 4 (including versions distributed
  22. under the GPL) are entitled to upgrade to the latest version of
  23. Directory Opus version 5 at a reduced price. Please see
  24. http://www.gpsoft.com.au for more information.
  25.  
  26. The release of Directory Opus 4 under the GPL in NO WAY affects
  27. the existing commercial status of Directory Opus 5.
  28.  
  29. */
  30.  
  31. #include "config.h"
  32.  
  33. void showpalettegad(one)
  34. int one;
  35. {
  36.     int a,b,x,y,w,h;
  37.  
  38.     b=1<<screen_depth;
  39.     if (b==4) w=54; else w=27;
  40.     if (b==16) h=6; else h=12;
  41.     x=x_off+298;
  42.     y=y_off+34;
  43.     for (a=0;a<b;a++) {
  44.         SetAPen(rp,screen_pens[a].pen);
  45.         RectFill(rp,x,y,x+w-1,y+h-1);
  46.         palettegad_xy[a][0]=x;
  47.         palettegad_xy[a][1]=y;
  48.         palettegad_xy[a][2]=x+w-1;
  49.         palettegad_xy[a][3]=y+h-1;
  50.         if (a==one) drawcompbox(rp,x,y,w,h);
  51.         x+=w;
  52.         if (a==7) {
  53.             x=x_off+298;
  54.             y=y_off+40;
  55.         }
  56.     }
  57. }
  58.  
  59. void scalecol(col)
  60. ULONG *col;
  61. {
  62.     int and;
  63.  
  64.     and=(1<<bpg)-1;
  65.     *col&=~and;
  66.     *col>>=(32-bpg);
  67. }
  68.  
  69. void scalecolup(col)
  70. ULONG *col;
  71. {
  72.     int and;
  73.  
  74.     *col<<=(32-bpg);
  75.     and=(1<<bpg)-1;
  76.     *col&=~and;
  77. }
  78.